<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="/css/font.css">
		<link rel="stylesheet" href="/css/xadmin.css">
	</head>

	<body>
		<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="#">成绩信息</a>
                <a>
                    <cite>重修课程</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);"
             title="刷新">
                <i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
		<div class="x-body" id="app">
			<span class="x-right" style="line-height:40px;float:left">共有数据：{{ stuScores.length }} 条</span>
			<table class="layui-table">
				<thead>
					<tr>
						<th>课程代码</th>
                        <th>课程名称</th>
                        <th width="100">课程性质</th>
                        <th width="100">重修成绩</th>
				</thead>
				<tbody>
					<tr v-for="stuScore in stuScores">
						<td>{{ stuScore.courseNo }}</td>
                        <td>{{ stuScore.courseName }}</td>
                        <td v-if="stuScore.courseType == 1">必修</td>
                        <td v-else-if="stuScore.courseType == 2">专业选修</td>
                        <td>{{ stuScore.retakeScore }}</td>
					</tr>
				</tbody>
			</table>
		</div>
        <script type="text/javascript" src="/js/jquery.min.js"></script>
        <script type="text/javascript" src="/js/vue.min.js"></script>
        <script type="text/javascript" src="/js/xadmin.js"></script>
        <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
        <script>
	        var vm = new Vue({
	            el : '#app',
	            data : {
	            	stuScores : ""
	            },
	            created : function() {
	               this.listRetakeCourse();
	            },
	            methods : {
	            	listRetakeCourse : function() {
	                    var vm = this;
	                    $.ajax({
	                        url : "/student/score/listRetakeCourse",
	                        type : "get",
	                        success : function(result) {
	                            if (result.state) {
	                            	vm.stuScores = result.data;
	                            } else {
	                                layui.use(['layer'], function(){
	                                    var layer = layui.layer
	                                    layer.msg(""+result.msg, {icon: 5});
	                                });
	                            }
	                        }
	                    });
	                }
	            }
	        });
        </script>
	</body>
</html>
